{extend name="public:_base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/admin/uploadify/uploadify.css">
{/block}
{block name="js"}
{include file="public/_validform"}
<!--上传配置 -->
<script src="__STATIC__/admin/uploadify/jquery.uploadify.min.js" type="text/javascript"></script>
<script src="__STATIC__/admin/js/upfile.js" type="text/javascript"></script>
<!-- 配置文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="__STATIC__/admin/hui/lib/ueditor/1.4.3/ueditor.all.js"></script>

<script type="text/javascript">

        var ue = UE.getEditor('editor');

        upload_image('image','','200','200');

        var URL = {
                uploader: '{:url('Upload/image')}',
                swf:'__STATIC__/admin/uploadify/uploadify.swf',
                ROOT:'__ROOT__/uploads/image',
                del_url:'{:url('Ucase/delimage')}',
                }
</script>
{/block}
{block name="main"}
<article class="page-container">
    <form class="form form-horizontal" action="{:url('Ucase/save')}" id="form" method="post">
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3"><span class="c-red">*</span>案例名称：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="text" class="input-text" value="{$data.title ?? ''}" placeholder="" datatype="*"
                       name="title">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">案例图：264*260</label>
            <div class="formControls col-xs-9 col-sm-9">
                <div id="image_s"><img src="__ROOT__/uploads/{$data.image ?'image/md_'.$data.image: 'sm_nopic.jpg'}" width="200px" height="200px"/></div>
                <input id="image_post" name="image" type="hidden" value="{$data.image ?? ''}"/>
                <input name="old_image" type="hidden" value="{$data.image ?? ''}"/>
                <input id="image" name="image_upload" type="file" multiple="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">多图片：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <div id="s_s">
                    {volist name="data.images|default=''" id="vo"}
                    <div style="width: 200px;height: 200px;float: left;">
                        <a href="__ROOT__/uploads/image/{$vo.image}" target="_blank" title="查看">
                            <img style="position: absolute;" width="200px" height="200px" src="__ROOT__/uploads/image/md_{$vo.image}">
                        </a><input name="images[]" value="{$vo.image}" type="hidden">
                        <a style="position: absolute;" onclick="delfile(this,'{$vo.image}');" title="删除">
                            <i class="Hui-iconfont" style="font-size: 28px;background: #fff;">&#xe6e2;</i>
                        </a>
                    </div>
                    {/volist}
                </div>
                <div class="clear"></div>
                <input id="s" name="duo" type="file" multiple="true">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">链接：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="url" class="input-text" value="{$data.url ?? ''}" placeholder="如：{:\\think\\Request::instance()->domain()}"
                       name="url">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">排序值：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="number" class="input-text" value="{$data.stor ?? ''}" placeholder=""
                       name="stor">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">关键词：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="text" class="input-text" value="{$data.key ?? ''}" placeholder="" id="keywords" name="key">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">案例摘要：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <textarea name="miaoshu" cols="" rows="" class="textarea" placeholder="说点什么...最少输入10个字符">{$data.miaoshu ?? ''}</textarea>
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">管理人：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <input type="text" class="input-text" value="{$data.issue ?? ''}" placeholder="" id="author"
                       name="issue">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-3 col-sm-3">案例内容：</label>
            <div class="formControls col-xs-9 col-sm-9">
                <script id="editor" type="text/plain" name="center" style="width:100%;height:400px;">{$data.center|default=''|html_entity_decode ?? ''}</script>
                </div>
        </div>

        <div class="row cl">
            <div class="col-xs-6 col-sm-6 col-xs-offset-4 col-sm-offset-2">
                    <input type="hidden" value="{$data.id ?? ''}" name="id">
                    <input type="hidden" value="{$data.cid ?? $addcid}" name="cid">
                    <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
                <button onClick="layer_close();" class="btn btn-default radius" type="button">
                    &nbsp;&nbsp;取消&nbsp;&nbsp;
                </button>
            </div>
        </div>
    </form>
</article>
{/block}